﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using NewDDSys.Entity;
using NewDDSys.IBLL;
using NewDDSys.IDAL;
using NewDDSys.Factory;
using NewDDSys.Utility;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

public partial class Web_HKCDT : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        btnOK.Attributes.Add("onclick", "javascript:if(confirm('" + "确认无误，并提交么？" + "')== false) return false;");
    }
    protected void btnRepeat_Click(object sender, EventArgs e)
    {
        txtKN.Text = "";
    }
    protected void btnOK_Click(object sender, EventArgs e)
    {
        int CheckValue = 0;
        HkcdtInfo hc = new HkcdtInfo();
        hc.Banzu = Session["用户信息.班组"].ToString();
        hc.Tianbao = Session["用户信息.姓名"].ToString();
        hc.Kday = DateTime.Now.ToString();
        hc.Dtnum = "HC" + hc.Kday;
        CheckValue = BLLFactory.CreateHkcdtBLL().Add(hc);
        if(CheckValue >= 1)
        {
            Response.Write(" <script   language=javascript> window.alert( ' 提交成功！ ');</script> ");
        }
        if (txtKN.Text.ToString() != "")
            BLLFactory.CreateHkcdtBLL().Update(hc.Dtnum, Convert.ToDecimal(txtKN.Text.ToString()));
        Response.Redirect("HKCDTJL.aspx");
    }
}
